<template>

    <!--筛选条件-->
    <div class="shaixuan2">
        <div class="daohang_content">
            <PersButton type="text" size="mini" icon="el-icon-goback" perms="sys:role:del" label="返回上一页"
                @click="goback"></PersButton>
        </div>
        
        <div class="first_table">
            <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border stripe default-expand-all v-loading="loading" >
                <el-table-column align="center" fixed  width="55" label="序号"  prop="id"></el-table-column>
                <el-table-column align="center" prop="tutor_nickname" label="邀请助教" header-align="center"></el-table-column>
                <el-table-column  align="center"  header-align="center" prop="headimgurl" label="被邀请用户头像">
                    <template slot-scope="scope">
                        <el-image :src="scope.row.headimgurl" fit="fill" style="width: 60px;height: 60px;"></el-image>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="nickname" label="被邀请用户昵称" header-align="center"></el-table-column>
                <el-table-column align="center" prop="phone" label="被邀请用户手机号" header-align="center"></el-table-column>
                <el-table-column align="center" prop="signin_time" label="进入直播间时间" header-align="center"></el-table-column>
                <el-table-column align="center" prop="status" label="是否到课" header-align="center">
                    <template slot-scope="scope">
                        <span>
                            {{ scope.row.status === 2 ? '是' : '否' }}
                        </span>
                </template>
                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNumber" :page-sizes="[10, 50, 100, 200]" :page-size="pageSize" background layout="total, sizes, prev, pager, next, jumper" :total="total">
                </el-pagination>
            </div>
        </div>
    </div>
</template>


<script>


    import {getyaoqing} from '@/api/live/action';
    import PersButton from '@/components/PersButton';

    export default {
        components:{
            PersButton
        },
        data(){
            return {
                pageSize: 10, //一页显示多少条
                pageNumber: 1,
                total: 0, //总页数
                input:'',
                tableData:[],
                loading: false,
                multipleSelectioncount: 0,
                typeinput:'1',
            }
        },
        props:{
            goback:{
                type:String,
                default:''
            },
            liveId:{
                type:String,
                default:''
            },
            live_user_id:{
                type:String,
                default:''
            },
            sender:{
                type:String,
                default:''
            },
        },
        created(){

            this.init();
            console.log(this.$route.query.liveId);
                console.log(this.$route.query.tutor_id);
        },
        methods: {
            
            init(){
                
                let _param = {
                    liveId:this.$route.query.liveId,
                    user_id:this.$route.query.live_user_id,
                    tutor_id:this.$route.query.tutor_id,
                    sender:this.$route.query.sender,
                    pageSize:this.pageSize,
                    pageNumber:this.pageNumber
                }
                getyaoqing(_param).then((res) => {
                    console.log(res.data.list);
                        if (res.code == 200) {
                            this.tableData = res.data.list;
                            this.total = res.data.total;
                        } else {
                            this.msgError(res.msg);
                        }
                    })
            },
            handleSizeChange: function (e) {
                console.log(e);
                this.pageSize = e;
                this.init();
            },
            handleCurrentChange: function (e) {
                console.log(e);
                this.pageNumber = e;
                this.init();
            },
            goback() {
            this.$router.go(-1);
        }
           
   
        }
        
    }

</script>


<style>
.daohang_content{
    height: 30px;
    display: flex;
    align-content: center;
    padding-top: 20px;

}
.yixuan {
    margin: 20px;
    color: #787878;
}

.shaixuan2{
    display: flex;
    flex-direction: column;
    width: 100%;
}
</style>